<template>
	<div>
		<HomeHeader></HomeHeader>
		<HomeLeft :cur="8"></HomeLeft>
		<div id="main">
			<div id="web_con">
				<div class="web_wp">
					<div class="web_location">
						<div class="here_area">
							<strong>当前位置：</strong>项目经理管理
						</div>
						<div class="here_btn">

						</div>
					</div>
					<div class="filter clearfix">
						<div class="aa">
							<div class="item">
								<span>年份：</span>
								<el-date-picker v-model="year" type="year" placeholder="开始时间" value-format="yyyy"
									:clearable="false" :picker-options="pickerOptions">
								</el-date-picker>
							</div>
							<div class="item">
								<span>关键词：</span>
								<input type="text" v-model="keywords" placeholder="请输入" class="fill_text">
							</div>
							<div class="item">
								<button class="but_search" @click="Seach()">搜 索</button>
							</div>
						</div>
						<div class="bb">

							<navigator url="/pages/project/edit" hover-class="none" class="web_btn">

								<em class="iconfont icon-shdcsub-add"></em>添加
							</navigator>
							<!-- <a href="javascript:;" class="web_btn" @click="DeleteList()">
								<em class="iconfont icon-shdcsub-add-copy"></em>删除
							</a> -->


							<!-- <a href="javascript:;" class="web_btn btn_refresh"><em
									class="iconfont icon-shdcexcel"></em>导出</a> -->

							<!-- <a href="javascript:;" class="web_btn" @click="DeleteList()">
								<em class="iconfont icon-shdcsub-add-copy"></em>冻结
							</a> -->
							<a href="javascript:;" class="web_btn btn_refresh" @click="Refresh()"><em
									class="iconfont icon-shdcshuaxin"></em>刷新</a>
						</div>
					</div>

					<div class="web_table">
						<table>
							<tr>
								<!-- <th class="tac" style="width: 60px;">选择</th> -->
								<th class="tac">项目经理姓名</th>
								<th class="tac">手机号</th>
								<th class="tac">商户管理预计收益</th>
								<th class="tac">商户管理已获得收益</th>
								<th class="tac">编辑</th>
							</tr>
							<tr v-for="(item,i) in listinfo.data" :key="i">
								<!-- <td class="tac">
									<el-checkbox v-model="item.checked"></el-checkbox>
								</td> -->
								<td class="tac">{{item.name}}</td>
								<td class="tac">{{item.phone}}</td>

								<td class="tac">
									<navigator class="txt_link"
										:url="'/pages/project/member2?id=' + item.id + '&name=' + item.name+ '&year=' + year"
										hover-class="none">{{item.predictFee}}
									</navigator>
								</td>

								<td class="tac">
									<navigator class="txt_link"
										:url="'/pages/project/member?id=' + item.id + '&name=' + item.name + '&year=' + year"
										hover-class="none">
										{{item.expiredFee}}
									</navigator>
								</td>
								<td class="tac">
									<navigator :url="'/pages/project/edit?id=' + item.id" hover-class="none"
										class="editBtn" title="编辑">
									</navigator>
								</td>
							</tr>
						</table>
					</div>
					<div class="web_page">
						<el-pagination background @current-change="ChengPage" :current-page="page" :page-size="10"
							layout="total,prev, pager,next" :total="listinfo.total">
						</el-pagination>
					</div>
				</div>
			</div>
		</div>
	</div>
</template>

<script>
	import HomeHeader from '../components/Header.vue'
	import HomeLeft from '../components/Left.vue'
	export default {
		components: {
			HomeHeader,
			HomeLeft,

		},
		data() {
			return {
				page: 1,
				listinfo: [],
				keywords: '',
				year: new Date().getFullYear().toString(),
				pickerOptions: {
					disabledDate(time) {
						return time.getFullYear() < new Date().getFullYear();
					},
				},
			}
		},
		onShow() {
			this.GetList();
		},
		methods: {

			Refresh: function() {
				this.keywords = '';
				this.year = new Date().getFullYear().toString(),
					this.Seach();
			},

			Seach: function() {
				this.page = 1;
				this.GetList();
			},
			ChengPage: function(e) {
				this.page = e;
				this.GetList();
			},

			GetList: function() {
				let that = this;
				uni.showLoading({
					title: '加载中...',
					mask: true
				});
				let _data = {
					keywords: that.keywords,
					page: that.page,
					per_page: 10,
					year: that.year
				};
				that.common.http('GET', 'manager', _data, function(res) {
					uni.hideLoading();
					console.log(res.data)
					that.listinfo = res.data
				});
			},
		}
	}
</script>

<style>


</style>